﻿
#include <QtWidgets/QApplication>
#include <QMessageBox>
#include <Windows.h>
#include "log/log.h"
#include "componentmanager.h"
#include "../SystemConfiguration/systemconfiguration.h"
#include "systemmainwid.h"

int main(int argc, char* argv[])
{
	SetConsoleOutputCP(CP_UTF8);
	QApplication app(argc, argv);
	Logger::GetInstance()->Init();
	LOG_ERROR("common", "/n/n---------------RobotSystemSimulator Start----------------------");

	if (!syscfg->Init("")) {
		QMessageBox::warning(nullptr, "启动失败", "配置文件初始化失败");
		return false;
	}

	if (!component->Init()) {
		QMessageBox::warning(nullptr, "启动失败", "组件加载失败" + component->GetErrorMsg());
		return 0;
	}
	SystemMainWid w;
	w.show();

	return app.exec();
}
